package com.sangmo.fts.training.model;

import com.sangmo.boot.framework.data.entity.general.LongEntity2;
import com.sangmo.boot.framework.data.json.meta.ExtView;
import com.sangmo.boot.framework.plugin.dataview.def.meta.DataField;
import com.sangmo.boot.framework.plugin.dataview.def.meta.DataView;
import com.sangmo.fts.common.IConstants;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.HashMap;
import java.util.Map;

@Entity
@Table(name = "training_history")
@DataView
@ExtView
public class TrainingHistory extends LongEntity2 {

    @DataField(value = IConstants.DATA_TYPE.LONG, required = true)
    private Long trainingId;

    @DataField(value = IConstants.DATA_TYPE.STRING_100, required = true)
    private String processNode;

    private String description;

    public Long getTrainingId() {
        return trainingId;
    }

    public void setTrainingId(Long trainingId) {
        this.trainingId = trainingId;
    }

    public String getProcessNode() {
        return processNode;
    }

    public void setProcessNode(String processNode) {
        this.processNode = processNode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static final Map<String, Integer> businessTypeMapProcessNodeTotal = new HashMap<String, Integer>() {
        {
            put(Training.BusinessTypes.INVENTORY_FINANCING, 16);
            put(Training.BusinessTypes.CONFIRMING_STORAGE_FINANCING, 24);
            put(Training.BusinessTypes.RECEIVABLE_PLEDGE_FINANCING, 14);
            put(Training.BusinessTypes.FACTORING_FINANCING, 15);
        }
    };

    public interface IfProcessNodes {
        String IF_CONTRACT_SELLER_CONFIRM_1 = "IF_CONTRACT_SELLER_CONFIRM_1";
        String IF_CONTRACT_BANK_CONFIRM_2 = "IF_CONTRACT_BANK_CONFIRM_2";
        String IF_CONTRACT_STORAGE_CONFIRM_3 = "IF_CONTRACT_STORAGE_CONFIRM_3";
        String IF_WAYBILL_SELLER_SHIP_4 = "IF_WAYBILL_SELLER_SHIP_4";
        String IF_WAYBILL_STORAGE_RECEIVE_5 = "IF_WAYBILL_STORAGE_RECEIVE_5";
        String IF_STOCK_STORAGE_APPROVE_6 = "IF_STOCK_STORAGE_APPROVE_6";
        String IF_LOAN_SELLER_APPLY_7 = "IF_LOAN_SELLER_APPLY_7";
        String IF_LOAN_BANK_AUDIT_8 = "IF_LOAN_BANK_AUDIT_8";
        String IF_LOAN_BANK_ISSUE_9 = "IF_LOAN_BANK_ISSUE_9";
        String IF_REPAYMENT_SELLER_PAY_10 = "IF_REPAYMENT_SELLER_PAY_10";
        String IF_LOAN_BANK_RECALL_11 = "IF_LOAN_BANK_RECALL_11";
        String IF_LADING_BILL_SELLER_APPLY_12 = "IF_LADING_BILL_SELLER_APPLY_12";
        String IF_LADING_BILL_BANK_CONFIRM_13 = "IF_LADING_BILL_BANK_CONFIRM_13";
        String IF_LADING_BILL_STORAGE_COMPLETE_14 = "IF_LADING_BILL_STORAGE_COMPLETE_14";
        String IF_OUTBOUND_STORAGE_DISPATCH_15 = "IF_OUTBOUND_STORAGE_DISPATCH_15";
        String IF_INBOUND_SELLER_STORE_16 = "IF_INBOUND_SELLER_STORE_16";
    }

    public interface CsfProcessNodes {
        String CSF_CONTRACT_BUYER_CONFIRM_1 = "CSF_CONTRACT_BUYER_CONFIRM_1";
        String CSF_CONTRACT_SELLER_CONFIRM_2 = "CSF_CONTRACT_SELLER_CONFIRM_2";
        String CSF_AGREEMENT_SELLER_CONFIRM_3 = "CSF_AGREEMENT_SELLER_CONFIRM_3";
        String CSF_AGREEMENT_BUYER_CONFIRM_4 = "CSF_AGREEMENT_BUYER_CONFIRM_4";
        String CSF_AGREEMENT_BANK_CONFIRM_5 = "CSF_AGREEMENT_BANK_CONFIRM_5";
        String CSF_AGREEMENT_STORAGE_CONFIRM_6 = "CSF_AGREEMENT_STORAGE_CONFIRM_6";
        String CSF_LOAN_BUYER_APPLY_7 = "CSF_LOAN_BUYER_APPLY_7";
        String CSF_LOAN_BANK_ACCEPT_8 = "CSF_LOAN_BANK_ACCEPT_8";
        String CSF_LOAN_BUYER_DEPOSIT_9 = "CSF_LOAN_BUYER_DEPOSIT_9";
        String CSF_ASSURANCE_STORAGE_CREATE_10 = "CSF_ASSURANCE_STORAGE_CREATE_10";
        String CSF_ASSURANCE_BUYER_CONFIRM_11 = "CSF_ASSURANCE_BUYER_CONFIRM_11";
        String CSF_LOAN_BANK_AUDIT_12 = "CSF_LOAN_BANK_AUDIT_12";
        String CSF_DRAFT_BANK_CREATE_13 = "CSF_DRAFT_BANK_CREATE_13";
        String CSF_WAYBILL_SELLER_SHIP_14 = "CSF_WAYBILL_SELLER_SHIP_14";
        String CSF_WAYBILL_STORAGE_RECEIVE_15 = "CSF_WAYBILL_STORAGE_RECEIVE_15";
        String CSF_STOCK_STORAGE_SUBMIT_16 = "CSF_STOCK_STORAGE_SUBMIT_16";
        String CSF_STOCK_BANK_CONFIRM_17 = "CSF_STOCK_BANK_CONFIRM_17";
        String CSF_REPAYMENT_BUYER_CREATE_18 = "CSF_REPAYMENT_BUYER_CREATE_18";
        String CSF_LOAN_BANK_RECALL_19 = "CSF_LOAN_BANK_RECALL_19";
        String CSF_LADING_BILL_BUYER_COMMIT_20 = "CSF_LADING_BILL_BUYER_APPLY_20";
        String CSF_LADING_BILL_BANK_CONFIRM_21 = "CSF_LADING_BILL_BANK_CONFIRM_21";
        String CSF_LADING_BILL_STORAGE_COMPLETE_22 = "CSF_LADING_BILL_STORAGE_COMPLETE_22";
        String CSF_OUTBOUND_STORAGE_DISPATCH_23 = "CSF_OUTBOUND_STORAGE_DISPATCH_23";
        String CSF_INBOUND_BUYER_STORE_24 = "CSF_INBOUND_BUYER_STORE_24";
    }

    public interface RpfProcessNodes {
        String RPF_CONTRACT_BUYER_CONFIRM_1 = "RPF_CONTRACT_BUYER_CONFIRM_1";
        String RPF_CONTRACT_SELLER_CONFIRM_2 = "RPF_CONTRACT_SELLER_CONFIRM_2";
        String RPF_WAYBILL_SELLER_SHIP_3 = "RPF_WAYBILL_SELLER_SHIP_3";
        String RPF_WAYBILL_BUYER_RECEIVE_4 = "RPF_WAYBILL_BUYER_RECEIVE_4";
        String RPF_LOAN_SELLER_APPLY_5 = "RPF_LOAN_SELLER_APPLY_5";
        String RPF_LOAN_BANK_ACCEPT_6 = "RPF_LOAN_BANK_ACCEPT_6";
        String RPF_PLEDGE_CONTRACT_SELLER_CONFIRM_7 = "RPF_PLEDGE_CONTRACT_SELLER_CONFIRM_7";
        String RPF_PLEDGE_CONTRACT_BANK_CONFIRM_8 = "RPF_PLEDGE_CONTRACT_BANK_CONFIRM_8";
        String RPF_PLEDGE_CONTRACT_BANK_REGISTER_AND_NOTIFY_9 = "RPF_PLEDGE_CONTRACT_BANK_REGISTER_AND_NOTIFY_9";
        String RPF_PLEDGE_CONTRACT_BUYER_CONFIRM_10 = "RPF_PLEDGE_CONTRACT_BUYER_CONFIRM_10";
        String RPF_LOAN_BANK_AUDIT_11 = "RPF_LOAN_BANK_AUDIT_11";
        String RPF_LOAN_BANK_ISSUE_12 = "RPF_LOAN_BANK_ISSUE_12";
        String RPF_REPAYMENT_BUYER_PAY_13 = "RPF_REPAYMENT_BUYER_PAY_13";
        String RPF_LOAN_BANK_RECALL_14 = "RPF_LOAN_BANK_RECALL_14";
    }

    public interface FfProcessNodes {
        String FF_CONTRACT_BUYER_CONFIRM_1 = "FF_CONTRACT_BUYER_CONFIRM_1";
        String FF_CONTRACT_SELLER_CONFIRM_2 = "FF_CONTRACT_SELLER_CONFIRM_2";
        String FF_WAYBILL_SELLER_SHIP_3 = "FF_WAYBILL_SELLER_SHIP_3";
        String FF_WAYBILL_BUYER_RECEIVE_4 = "FF_WAYBILL_BUYER_RECEIVE_4";
        String FF_LOAN_SELLER_APPLY_5 = "FF_LOAN_SELLER_APPLY_5";
        String FF_LOAN_BANK_ACCEPT_6 = "FF_LOAN_BANK_ACCEPT_6";
        String FF_FACTORING_CONTRACT_BANK_CONFIRM_7 = "FF_FACTORING_CONTRACT_BANK_CONFIRM_7";
        String FF_FACTORING_CONTRACT_SELLER_CONFIRM_8 = "FF_FACTORING_CONTRACT_SELLER_CONFIRM_8";
        String FF_TRANSFER_APPLY_SELLER_SUBMIT_9 = "FF_TRANSFER_APPLY_SELLER_SUBMIT_9";
        String FF_TRANSFER_APPLY_BANK_CONFIRM_10 = "FF_TRANSFER_APPLY_BANK_CONFIRM_10";
        String FF_TRANSFER_APPLY_BUYER_CONFIRM_11 = "FF_TRANSFER_APPLY_BUYER_CONFIRM_11";
        String FF_LOAN_BANK_ISSUE_12 = "FF_LOAN_BANK_ISSUE_12";
        String FF_REPAYMENT_BUYER_PAY_13 = "FF_LOAN_BUYER_PAY_13";
        String FF_LOAN_BANK_RECALL_14 = "FF_LOAN_BANK_RECALL_14";
        String FF_LOAN_SELLER_PAY_15 = "FF_LOAN_SELLER_PAY_15";

    }
}
